配置emacs hexo github page aliyun oss博客环境

安装hexo

  1. 安装node npm
    由于我的电脑是ubuntu
    可以使用 apt方试安装sudo apt-get install nodejs
    或者编译安装,这里不详系介绍
    (※我使用的编译源码方试安装,这种方试安装的是最新版※)
  2. 安装hexo

    1
    2
    3
    4
    5
    npm install hexo-cli -g 
    hexo init blog
    cd blog
    npm install
    hexo server
  3. 安装git
    同1;
    sudo apt-get install git
    编译安装可以看这里

    编译安装git

配置hexo themes

hexo themes 可以去官网找 themes
※可能需要翻墙※

我用的是next themes.
github地址
使用文档

配置emacs hexo插件

*我使用的是spacemacs,所以创建一个layer
m-x create-layer
创建layer

编辑package.el
test_编辑package.png

可以使用hexo-my-blog打开hexo buffer
test_hexo_buffer.png

配置aliyun oss

我使用的是阿里云ossimport同步工具
ossimport快速安装

  1. 下载
    wget http://import-service-package.oss.aliyuncs.com/ossimport2/ossimport-v2.1-linux.zip
  2. 解压
    unzip ./ossimport-v2.1-linux.zip -d ./ossimport-v2.1-linux
  3. 配置conf/sys.properties
    vi conf/sys.properties
    test_配置sysproperties.png
    ※跟具个人实际情况配置
  4. 运行

    1. 启动服务
      nohup java -Dskip_exist_file=false -jar /home/willeam/software/aliyun/oss/ossimport-v2.1-linux/bin/ossimport2.jar -c /home/willeam/software/aliyun/oss/ossimport-v2.1-linux/conf/sys.properties start > /home/willeam/software/aliyun/oss/ossimport-v2.1-linux/logs/ossimport2.log 2>&1 &
    2. 编辑任务描述文件
      vi local_job.cfg
      test_20170316_165446.png

    3. 启动服务
      java -jar /home/willeam/software/aliyun/oss/ossimport-v2.1-linux/bin/ossimport2.jar -c /home/willeam/software/aliyun/oss/ossimport-v2.1-linux/conf/sys.properties submit /home/willeam/software/aliyun/oss/ossimport-v2.1-linux/local_job.cfg

    4. 查看状态

      1
      java -jar /home/willeam/software/aliyun/oss/ossimport-v2.1-linux/bin/ossimport2.jar -c /home/willeam/software/aliyun/oss/ossimport-v2.1-linux/conf/sys.properties  stat detail

      停止服务

      1
      2
      ps axu | grep "ossimport2.jar.* start" | grep -v grep | awk '{print "kill -9 "$2}' | bash
      java -jar $work_dir/bin/ossimport2.jar -c $work_dir/conf/sys.properties clean local_test
坚持原创技术分享,您的支持将鼓励我继续创作!